package com.bnz.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Transient;

@AllArgsConstructor
@NoArgsConstructor
@Data
@Entity(name = "student")
public class Student {
    @Id
    private Integer sid;
    private String sname;

    private String sex;
    private Integer age;
    private String addr;
    private Integer cid;

   @Transient
    private String cname;

    public Student(String sname, String sex, Integer age, String addr, Integer cid) {
        this.sname = sname;
        this.sex = sex;
        this.age = age;
        this.addr = addr;
        this.cid = cid;
    }
}
